<extend name="Public/base"/>

<block name="body">
    <div class="main-title">
        <h2>{$meta_title}</h2>
    </div>
    <div class="cf">

        <form action="{:U()}" method="post" class="form-horizontal">
            <div class="control-group">
                <label class="control-label" for="inputMailId">邮件模版号：</label>
                <div class="controls">
                    <input type="text" id="inputMailId" name="mailId" placeholder="(选填)请输入邮件模版号">
                    <span class="small">（选填内容，如果您不知道最好不要填写）</span>
                </div>
            </div>
            <hr/>
            <div class="control-group">
                <label class="control-label" for="inputEmail">发送到邮箱：</label>
                <div class="controls">
                    <input type="text" id="inputEmail" name="to" placeholder="请输入邮箱地址，如：juexin@guilins.com">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="inputTitle">邮件标题：</label>
                <div class="controls">
                    <input type="text" id="inputTitle" name="title" placeholder="请输入邮件标题">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="inputContent">邮件内容：</label>
                <div class="controls">
                    <textarea id="inputContent" name="body">在此输入邮件内容</textarea>
                    {:hook('adminArticleEdit', array('name'=>'body','value'=>''))}
                </div>
            </div>
            <div class="control-group">
                <div class="controls">
                    <button type="submit" class="btn">发送</button>
                </div>
            </div>
        </form>
        </div>


</block>

<!-- 加载底部JS -->
<block name="script">
    <script>
        $("input[name='mailId']").change(function(){
            if($(this).val() > 0){
                $("input[name='title'],input[name='body']").addClass('disabled');
            }else{
                $("input[name='title'],input[name='body']").removeClass('disabled');
            }
        });
    </script>
</block>